const path = require('path');

function resolve(dir) {
	return path.join(__dirname, dir);
}

module.exports = {
	lintOnSave: true,
	publicPath: '/',
	chainWebpack: (config) => {
		config.resolve.alias
			.set('@', resolve('src'))
			.set('~', resolve('src/assets/css'))
			.set('#', resolve('src/components'))
	},
	devServer: {
		proxy: {
			'/api': {
				target: 'https://api.it120.cc/',
				ws: true,
				changeOrigin: true,
				pathRewrite: {
					'^/api': ''
				}
			}
		}
	}
}
